package org.expample.common;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.Properties;

/**
 * @author will
 * @description:
 */
@Slf4j
public class Utils {
    public static void loadPropertySource(Class clazz, String fileName) {
        Properties p = new Properties();
        try {
            p.load(clazz.getResourceAsStream(fileName));
            p.forEach((k, v) -> {
                log.info("load property,{}={}", k, v);
                System.setProperty(k.toString(), v.toString());
            });
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
